package com.master.demo;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * Annotation @XmlElement must put to the fields
 * if put to the getter method, all the fields of the entity will be null
 */
@XmlRootElement(name = "msg")
public class Message {
	@XmlElement
	String name;
	@XmlElement
	String text;

	public Message(){
		
	}
	
	public Message(String name, String text) {
		this.name = name;
		this.text = text;
	}

	public String getName() {
		return name;
	}
	
	public String getText() {
		return text;
	}

	@Override
	public String toString() {
		return "Message{" +
				"name='" + name + '\'' +
				", text='" + text + '\'' +
				'}';
	}

}
